kop_sokwedb
10 months agoROLES.Participant must be under study
Karl O. Pinc kop@karlpinc.com [Sun, 5 Oct 2025 17:39:28 +0000 (17:39 +0000)]
ROLES.Participant must be under study

10 months agoPrevent EVENTS.FID from changing
Karl O. Pinc kop@karlpinc.com [Sun, 5 Oct 2025 15:54:42 +0000 (15:54 +0000)]
Prevent EVENTS.FID from changing

If the FID is allowed to change, at minimum -- there may be other
cases, the check that ROLES.Participant must be under study
becomes complicated.  It would require code in the triggers
to trace the BIOGRAPHY_DATA.Animid <- ROLES.Participant ->
EVENTS.EID --> FOLLOWS.FID chain to check FOLLOWS.Date
against biography.  Simpler to dis-allow change.

10 months agoCreate and document the ARRIVALS table
Karl O. Pinc kop@karlpinc.com [Sun, 5 Oct 2025 15:46:26 +0000 (15:46 +0000)]
Create and document the ARRIVALS table

10 months agoAdd substitution reference for "tri-valued logic"
Karl O. Pinc kop@karlpinc.com [Sun, 5 Oct 2025 15:44:54 +0000 (15:44 +0000)]
Add substitution reference for "tri-valued logic"

10 months agoEnforce single-ROLE row restrction for arrival events
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 23:54:32 +0000 (23:54 +0000)]
Enforce single-ROLE row restrction for arrival events

10 months agoPrevent ROLES.EID from changing
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 23:25:57 +0000 (23:25 +0000)]
Prevent ROLES.EID from changing

10 months agoPrevent EVENTS.Behavior from changing
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 23:24:56 +0000 (23:24 +0000)]
Prevent EVENTS.Behavior from changing

10 months agoMore documentation of EVENTS.Behavior related rules
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 22:27:43 +0000 (22:27 +0000)]
More documentation of EVENTS.Behavior related rules

10 months agoImplement Start and Stop column constraints on EVENTS
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 22:24:36 +0000 (22:24 +0000)]
Implement Start and Stop column constraints on EVENTS

10 months agoInitial trigger on ROLES, prevent PID change
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 22:09:58 +0000 (22:09 +0000)]
Initial trigger on ROLES, prevent PID change

10 months agoInitial trigger on EVENTS, prevent EID change
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 22:07:47 +0000 (22:07 +0000)]
Initial trigger on EVENTS, prevent EID change

10 months agoAdd ARRIVAL_SOURCES table; codes for arrvial/departure data source
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 20:46:44 +0000 (20:46 +0000)]
Add ARRIVAL_SOURCES table; codes for arrvial/departure data source

10 months agoIndex ROLES
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 17:08:09 +0000 (17:08 +0000)]
Index ROLES

10 months agoIndex EVENTS
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 16:52:00 +0000 (16:52 +0000)]
Index EVENTS

10 months agoConvert FOLLOW_STUDIES
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 16:36:59 +0000 (16:36 +0000)]
Convert FOLLOW_STUDIES

10 months agoIndex FOLLOW_STUDIES
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 16:07:25 +0000 (16:07 +0000)]
Index FOLLOW_STUDIES

10 months agoIndex FOLLOW_OBSERVERS
Karl O. Pinc kop@karlpinc.com [Fri, 3 Oct 2025 15:04:00 +0000 (15:04 +0000)]
Index FOLLOW_OBSERVERS

10 months agoMake ROLE_CODES.Role unique when ignoring case
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 23:36:58 +0000 (23:36 +0000)]
Make ROLE_CODES.Role unique when ignoring case

10 months agoMake PEOPLE.Person unique when ignoring case
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 23:33:58 +0000 (23:33 +0000)]
Make PEOPLE.Person unique when ignoring case

10 months agoMake OBS_PERIODS.Period unique when ignoring case
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 23:29:58 +0000 (23:29 +0000)]
Make OBS_PERIODS.Period unique when ignoring case

10 months agoMake CYCLE_STATES.Code unique when ignoring case
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 23:26:58 +0000 (23:26 +0000)]
Make CYCLE_STATES.Code unique when ignoring case

10 months agoMake COMM_MEMBS_SOURCES.CommMembSource unique when ignoring case
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 23:21:24 +0000 (23:21 +0000)]
Make COMM_MEMBS_SOURCES.CommMembSource unique when ignoring case

10 months agoMake COMM_IDS.Name unique when ignoring case
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 23:15:15 +0000 (23:15 +0000)]
Make COMM_IDS.Name unique when ignoring case

10 months agoMake comm_ids.CommID unique when ignoring case
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 23:10:28 +0000 (23:10 +0000)]
Make comm_ids.CommID unique when ignoring case

10 months agoNew substitution reference for case-unique key columns
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 23:03:49 +0000 (23:03 +0000)]
New substitution reference for case-unique key columns

10 months agoUse indexmacros.m4 when creating indexes
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 22:53:20 +0000 (22:53 +0000)]
Use indexmacros.m4 when creating indexes

10 months agoAdd sdb_case_equalivance() macro for use in indexes
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 22:43:30 +0000 (22:43 +0000)]
Add sdb_case_equalivance() macro for use in indexes

10 months agoConvert follow -> follow_observers
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 22:18:05 +0000 (22:18 +0000)]
Convert follow -> follow_observers

There are a number of references to problem numbers, where we
automate fixes.  These have not been approved by the PIs and
may change.

10 months agoEnforce rule that a follow must have a related FOLLOW_OBSERVERS row
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 22:13:46 +0000 (22:13 +0000)]
Enforce rule that a follow must have a related FOLLOW_OBSERVERS row

10 months agoAllow PEOPLE.Person to have embedded spaces
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 22:11:17 +0000 (22:11 +0000)]
Allow PEOPLE.Person to have embedded spaces

10 months agoAdd creation of a NONE person to the conversion
Karl O. Pinc kop@karlpinc.com [Thu, 2 Oct 2025 22:02:34 +0000 (22:02 +0000)]
Add creation of a NONE person to the conversion

10 months agoAdd warning when it looks like there's duplicate FOLLOW_OBSERVERS
Karl O. Pinc kop@karlpinc.com [Wed, 1 Oct 2025 22:16:42 +0000 (22:16 +0000)]
Add warning when it looks like there's duplicate FOLLOW_OBSERVERS

10 months agoThe BIOGRAPHY_LOG.BLID cannot change
Karl O. Pinc kop@karlpinc.com [Wed, 1 Oct 2025 21:31:44 +0000 (21:31 +0000)]
The BIOGRAPHY_LOG.BLID cannot change

10 months agoThe COMM_MEMB_LOG.CommMLID cannot change
Karl O. Pinc kop@karlpinc.com [Wed, 1 Oct 2025 21:27:44 +0000 (21:27 +0000)]
The COMM_MEMB_LOG.CommMLID cannot change

10 months agoThe COMM_MEMBS.CommMID cannot change
Karl O. Pinc kop@karlpinc.com [Wed, 1 Oct 2025 21:21:32 +0000 (21:21 +0000)]
The COMM_MEMBS.CommMID cannot change

10 months agoThe FOLLOW_OBSERVERS.FOID cannot change
Karl O. Pinc kop@karlpinc.com [Wed, 1 Oct 2025 21:18:32 +0000 (21:18 +0000)]
The FOLLOW_OBSERVERS.FOID cannot change

10 months agoThe FOLLOWS.FID cannot change
Karl O. Pinc kop@karlpinc.com [Wed, 1 Oct 2025 21:15:19 +0000 (21:15 +0000)]
The FOLLOWS.FID cannot change

10 months agoConvert into the FOLLOWS table
Karl O. Pinc kop@karlpinc.com [Mon, 29 Sep 2025 23:03:33 +0000 (23:03 +0000)]
Convert into the FOLLOWS table

10 months agoCheck that a follow happens only when the individual is under study
Karl O. Pinc kop@karlpinc.com [Mon, 29 Sep 2025 22:26:07 +0000 (22:26 +0000)]
Check that a follow happens only when the individual is under study

Add INSERT and UPDATE trigger to FOLLOWS table.  Adjust BIOGRAPHY_DATA
triggers for check of changes to Entrydate and Departdate.

10 months agoIndex the FOLLOWS table
Karl O. Pinc kop@karlpinc.com [Mon, 29 Sep 2025 19:07:54 +0000 (19:07 +0000)]
Index the FOLLOWS table

10 months agoUse constraint allowing empty text for FOLLOWS.Notes
Karl O. Pinc kop@karlpinc.com [Mon, 29 Sep 2025 14:24:47 +0000 (14:24 +0000)]
Use constraint allowing empty text for FOLLOWS.Notes

10 months agoAdd ROLES table
Karl O. Pinc kop@karlpinc.com [Mon, 22 Sep 2025 13:34:03 +0000 (13:34 +0000)]
Add ROLES table

10 months agoMerge branch 'master' of /srv/repos/kop_sokwedb
Karl O. Pinc kop@karlpinc.com [Sun, 21 Sep 2025 22:45:33 +0000 (22:45 +0000)]
Merge branch 'master' of /srv/repos/kop_sokwedb

10 months agoModify diagram: An EVENTS row need not always have a related row on ROLES
Karl O. Pinc [Sun, 21 Sep 2025 22:41:43 +0000 (17:41 -0500)]
Modify diagram: An EVENTS row need not always have a related row on ROLES

10 months agoAdd ROLE_CODES table
Karl O. Pinc kop@karlpinc.com [Sun, 21 Sep 2025 22:10:23 +0000 (22:10 +0000)]
Add ROLE_CODES table

10 months agoAdd CYCLE_STATES table to db
Karl O. Pinc kop@karlpinc.com [Sun, 21 Sep 2025 21:43:35 +0000 (21:43 +0000)]
Add CYCLE_STATES table to db

10 months agoAdd SPECIES_PRESENT table
Karl O. Pinc kop@karlpinc.com [Sun, 21 Sep 2025 21:16:51 +0000 (21:16 +0000)]
Add SPECIES_PRESENT table

10 months agoEnforce PEOPLE.Active on FOLLOW_OBSERVERS
Karl O. Pinc kop@karlpinc.com [Sun, 21 Sep 2025 19:06:39 +0000 (19:06 +0000)]
Enforce PEOPLE.Active on FOLLOW_OBSERVERS

10 months agoNew macro for checking that PEOPLE.Active is TRUE before use
Karl O. Pinc kop@karlpinc.com [Sun, 21 Sep 2025 18:30:16 +0000 (18:30 +0000)]
New macro for checking that PEOPLE.Active is TRUE before use

10 months agoAdd SPECIES table
Karl O. Pinc kop@karlpinc.com [Tue, 9 Sep 2025 23:15:32 +0000 (23:15 +0000)]
Add SPECIES table

10 months agoAdd HUMANS table
Karl O. Pinc kop@karlpinc.com [Mon, 8 Sep 2025 22:28:39 +0000 (22:28 +0000)]
Add HUMANS table

11 months agoAdd nonnegative macros/substitution
Karl O. Pinc kop@karlpinc.com [Mon, 8 Sep 2025 22:27:53 +0000 (22:27 +0000)]
Add nonnegative macros/substitution

11 months agoInitial list of event codes, without hyperlinking to relevant tables
Karl O. Pinc kop@karlpinc.com [Mon, 8 Sep 2025 15:28:55 +0000 (15:28 +0000)]
Initial list of event codes, without hyperlinking to relevant tables

11 months agoSupport converting MGM, MGF, MGF2, MGF3
Karl O. Pinc kop@karlpinc.com [Mon, 8 Sep 2025 15:14:11 +0000 (15:14 +0000)]
Support converting MGM, MGF, MGF2, MGF3

11 months agoMake system aware of MGM, MGF, MGF2, and MGF3 unknown individuals
Karl O. Pinc kop@karlpinc.com [Mon, 8 Sep 2025 15:03:20 +0000 (15:03 +0000)]
Make system aware of MGM, MGF, MGF2, and MGF3 unknown individuals

11 months agoAdd CERTAINTIES table
Karl O. Pinc kop@karlpinc.com [Mon, 8 Sep 2025 14:59:40 +0000 (14:59 +0000)]
Add CERTAINTIES table

11 months agoMerge branch 'master' of /srv/repos/kop_sokwedb
Karl O. Pinc kop@karlpinc.com [Mon, 8 Sep 2025 14:57:10 +0000 (14:57 +0000)]
Merge branch 'master' of /srv/repos/kop_sokwedb

11 months agoRemove EVENTS.Seq column from diagram
Karl O. Pinc [Mon, 8 Sep 2025 14:35:30 +0000 (09:35 -0500)]
Remove EVENTS.Seq column from diagram

11 months agoChange EVENTS.End to EVENTS.Stop in diagrams
Karl O. Pinc [Mon, 8 Sep 2025 14:33:22 +0000 (09:33 -0500)]
Change EVENTS.End to EVENTS.Stop in diagrams

11 months agoAdd EVENTS table
Karl O. Pinc kop@karlpinc.com [Mon, 8 Sep 2025 13:12:34 +0000 (13:12 +0000)]
Add EVENTS table

11 months agoRemove EVENTS.Seq column from diagram
Karl O. Pinc [Mon, 8 Sep 2025 14:35:30 +0000 (09:35 -0500)]
Remove EVENTS.Seq column from diagram

11 months agoChange EVENTS.End to EVENTS.Stop in diagrams
Karl O. Pinc [Mon, 8 Sep 2025 14:33:22 +0000 (09:33 -0500)]
Change EVENTS.End to EVENTS.Stop in diagrams

11 months agoRemove FOLLOW_ARRIVALS table in favor of the EVENTS model
Karl O. Pinc kop@karlpinc.com [Mon, 8 Sep 2025 13:02:48 +0000 (13:02 +0000)]
Remove FOLLOW_ARRIVALS table in favor of the EVENTS model

Comment out some other tables, until the ARRIVALS table exists
and needs them.
Rename the constant which identifies an arriving individual with
certainty.

11 months agoSeconds are 0 in times unless otherwise noted
Karl O. Pinc kop@karlpinc.com [Mon, 8 Sep 2025 12:27:35 +0000 (12:27 +0000)]
Seconds are 0 in times unless otherwise noted

11 months agoGive the unknown individuals a bccertainty and a sex
Karl O. Pinc kop@karlpinc.com [Sun, 7 Sep 2025 23:02:24 +0000 (23:02 +0000)]
Give the unknown individuals a bccertainty and a sex

11 months agoAdjust to allow conversion to take a connection string
Karl O. Pinc kop@karlpinc.com [Sun, 7 Sep 2025 22:27:01 +0000 (22:27 +0000)]
Adjust to allow conversion to take a connection string

11 months agoAdd FOLLOW_STUDIES table
Karl O. Pinc kop@karlpinc.com [Sun, 7 Sep 2025 17:30:17 +0000 (17:30 +0000)]
Add FOLLOW_STUDIES table

11 months agoAdd STUDIES code table
Karl O. Pinc kop@karlpinc.com [Sun, 7 Sep 2025 17:27:02 +0000 (17:27 +0000)]
Add STUDIES code table

11 months agoAdd FOLLOW_OBSERVERS table
Karl O. Pinc kop@karlpinc.com [Sun, 7 Sep 2025 17:25:39 +0000 (17:25 +0000)]
Add FOLLOW_OBSERVERS table

11 months agoAdd OBS_PERIODS code table
Karl O. Pinc kop@karlpinc.com [Sun, 7 Sep 2025 17:10:37 +0000 (17:10 +0000)]
Add OBS_PERIODS code table

13 months agoFix so all :ref:s are removed, and other fixes
Karl O. Pinc [Wed, 25 Jun 2025 22:31:17 +0000 (17:31 -0500)]
Fix so all :ref:s are removed, and other fixes

Port fixes from PRIMEDB from EVA MPG.

Previously, only refs without a space in the subsituted text were removed.
Also, fix so EOF ending a block works.

16 months agoUse a connection string with PSQL
Karl O. Pinc kop@karlpinc.com [Sat, 12 Apr 2025 19:02:02 +0000 (19:02 +0000)]
Use a connection string with PSQL

16 months agoFully qualify table name
Karl O. Pinc kop@karlpinc.com [Sat, 12 Apr 2025 18:56:58 +0000 (18:56 +0000)]
Fully qualify table name

16 months agoCOMM_MEMB_LOG.AnimID does not have to reference BIOGRAPHY_DATA
Karl O. Pinc kop@karlpinc.com [Sat, 12 Apr 2025 18:52:11 +0000 (18:52 +0000)]
COMM_MEMB_LOG.AnimID does not have to reference BIOGRAPHY_DATA

Fixes problem #17.

16 months agoBIOGRAPHY_LOG.AnimID does not have to reference BIOGRAPHY_DATA
Karl O. Pinc kop@karlpinc.com [Sat, 12 Apr 2025 18:34:02 +0000 (18:34 +0000)]
BIOGRAPHY_LOG.AnimID does not have to reference BIOGRAPHY_DATA

Fixes problem #22.

16 months agoNew macro for columns named AnimID but are not required to be foreign keys
Karl O. Pinc kop@karlpinc.com [Sat, 12 Apr 2025 18:32:29 +0000 (18:32 +0000)]
New macro for columns named AnimID but are not required to be foreign keys

16 months agoAdjust conversion for tables dropped in the upstream MS Access db
Karl O. Pinc kop@karlpinc.com [Fri, 11 Apr 2025 22:45:39 +0000 (22:45 +0000)]
Adjust conversion for tables dropped in the upstream MS Access db

16 months agoAdd after_* targets for completing the conversion after a given step
Karl O. Pinc kop@karlpinc.com [Fri, 11 Apr 2025 22:43:14 +0000 (22:43 +0000)]
Add after_* targets for completing the conversion after a given step

16 months agoMake clear that tables are not entities
Karl O. Pinc [Thu, 10 Apr 2025 14:23:24 +0000 (09:23 -0500)]
Make clear that tables are not entities

16 months agoGROOMINGS.Certainty -> GROOMINGS.TimeCertainty
Karl O. Pinc [Tue, 1 Apr 2025 22:52:51 +0000 (17:52 -0500)]
GROOMINGS.Certainty -> GROOMINGS.TimeCertainty

16 months agoAdd event ER diagram to docs
Karl O. Pinc [Tue, 1 Apr 2025 22:43:42 +0000 (17:43 -0500)]
Add event ER diagram to docs

16 months agoAdd many event related tables to the events ER diagram
Karl O. Pinc [Tue, 1 Apr 2025 22:28:34 +0000 (17:28 -0500)]
Add many event related tables to the events ER diagram

16 months agoChange PARTS table name to ROLES
Karl O. Pinc [Tue, 1 Apr 2025 18:30:23 +0000 (13:30 -0500)]
Change PARTS table name to ROLES

17 months agoExplain why ER diagrams are useful
Karl O. Pinc [Fri, 7 Mar 2025 16:49:04 +0000 (10:49 -0600)]
Explain why ER diagrams are useful

17 months agoAdd diagram for EVENTS with arrivals, food, other species, and humans
Karl O. Pinc [Tue, 4 Mar 2025 00:38:13 +0000 (18:38 -0600)]
Add diagram for EVENTS with arrivals, food, other species, and humans

17 months agoAdd EVENTS and PARTS tables, remove event related tables
Karl O. Pinc [Tue, 4 Mar 2025 00:37:21 +0000 (18:37 -0600)]
Add EVENTS and PARTS tables, remove event related tables

17 months agoDocument what breaks the system
Karl O. Pinc kop@karlpinc.com [Mon, 3 Mar 2025 22:21:46 +0000 (22:21 +0000)]
Document what breaks the system

17 months agoAdd lower limit for FOLLOWS.Date
Karl O. Pinc kop@karlpinc.com [Sat, 1 Mar 2025 00:05:27 +0000 (00:05 +0000)]
Add lower limit for FOLLOWS.Date

17 months agoInitial definition of the FOLLOWS table
Karl O. Pinc kop@karlpinc.com [Fri, 28 Feb 2025 23:52:47 +0000 (23:52 +0000)]
Initial definition of the FOLLOWS table

17 months agoSwap FOLLOWS.Notes and Date columns so Notes comes last
Karl O. Pinc kop@karlpinc.com [Fri, 28 Feb 2025 23:46:47 +0000 (23:46 +0000)]
Swap FOLLOWS.Notes and Date columns so Notes comes last

17 months agoSwap FOLLOWS.Date and Notes columns so Notes is the last column
Karl O. Pinc [Fri, 28 Feb 2025 23:44:47 +0000 (17:44 -0600)]
Swap FOLLOWS.Date and Notes columns so Notes is the last column

17 months agoUse macro for key column generation
Karl O. Pinc kop@karlpinc.com [Fri, 28 Feb 2025 23:26:54 +0000 (23:26 +0000)]
Use macro for key column generation

17 months agoPort macros and Sphinx substitutions
Karl O. Pinc [Wed, 26 Feb 2025 23:25:29 +0000 (17:25 -0600)]
Port macros and Sphinx substitutions

17 months agoYou cannot have COMMENTs for functions which share a name with other objects
Karl O. Pinc [Wed, 26 Feb 2025 18:31:15 +0000 (12:31 -0600)]
You cannot have COMMENTs for functions which share a name with other objects

The solution is to have a separate syntax for function comments.
It is not worth the work at this time.

17 months agoImprove error message when a function cannot be commented
Karl O. Pinc [Tue, 25 Feb 2025 21:24:59 +0000 (15:24 -0600)]
Improve error message when a function cannot be commented

17 months agoMerge branch 'master' of /srv/repos/kop_sokwedb
Karl O. Pinc kop@karlpinc.com [Tue, 25 Feb 2025 21:20:25 +0000 (21:20 +0000)]
Merge branch 'master' of /srv/repos/kop_sokwedb

17 months agoMacro to prevent change of system maintained column
Karl O. Pinc [Tue, 25 Feb 2025 21:19:44 +0000 (15:19 -0600)]
Macro to prevent change of system maintained column

17 months agoRevert "Change FOLLOW_OBSERVERS.OBS_BRec to OBS_TRec"
Karl O. Pinc kop@karlpinc.com [Mon, 24 Feb 2025 23:01:36 +0000 (23:01 +0000)]
Revert "Change FOLLOW_OBSERVERS.OBS_BRec to OBS_TRec"

This reverts commit b902731a2460d6fa455ceac07c6b44e4bc92b800.

17 months agoFix error message on INSERT of automatically maintained columns
Karl O. Pinc kop@karlpinc.com [Sun, 23 Feb 2025 21:33:47 +0000 (21:33 +0000)]
Fix error message on INSERT of automatically maintained columns

17 months agoMacros and replacement text for automatically generated column content
Karl O. Pinc kop@karlpinc.com [Sat, 22 Feb 2025 23:04:46 +0000 (23:04 +0000)]
Macros and replacement text for automatically generated column content